package cn.gs.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import cn.gs.dao.VisitDao;
import cn.gs.dao.VisitDaoImpl;
import cn.gs.domain.Customer;
import cn.gs.domain.Visit;

@Service(value="VisitService")
@Scope("prototype")
public class VisitServiceImp implements VisitService {
	
	@Resource(name="VisitDao")
	VisitDao vd;
	public  List<Customer> selectCustom() {
		List<Customer> list=vd.selectCustom();
		return list;
	}
	@Override
	public void add(Visit v) {
		vd.add(v);		
	}
	@Override
	public List<Visit> paging(int page) {
		VisitDao vd1=new VisitDaoImpl();
		List<Visit> list=vd1.paging(page);
		return list;
	}
	@Override
	public List<Visit> selectPageCount() {
		VisitDao vd1=new VisitDaoImpl();
		List<Visit> list=vd1.selectPageCount();
		return list;
	}
	@Override
	public Visit selectByID(String id) {
		VisitDao vd1=new VisitDaoImpl();
		Visit v= vd1.selectByID(id);
		return v;
	}
	@Override
	public void update(Visit v) {
		VisitDao vd1=new VisitDaoImpl();
		vd1.update(v);		
	}
	@Override
	public void delete(String id) {
		VisitDao vd1=new VisitDaoImpl();
		vd1.delete(id);				
	}
	@Override
	public List<Visit> selName(String name) {
		VisitDao vd1=new VisitDaoImpl();
		 List<Visit> list= vd1.selName(name);	
		 return list;
	}
}
